#include "EpilThenBlockCode.h"
#include "TCharSupport.h"
#include "EpilOutputHelper.h"
#include "EpilPointerHelper.h"


EpilThenBlockCode::EpilThenBlockCode( const EpilLexLocation & location )
: EpilCodeBase( location )
, m_chunk( NULL )
, m_condition( NULL )
{
}


EpilThenBlockCode::~EpilThenBlockCode()
{
	EpilPointerHelper::SafeDelete( m_condition );
	EpilPointerHelper::SafeDelete( m_chunk );
}


tstring EpilThenBlockCode::ToEpilCode( int indent ) const
{
	tstringstream ret;
	ret << m_condition->ToEpilCode();
	ret << t(" then");
	ret << endl;
	ret << m_chunk->ToEpilCode( indent + 1 );
	return ret.str();
}